﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DomainModel;
using BL;

namespace SL
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service2" in code, svc and config file together.
    public class SLOrder : ISLOrder
    {
        //InsertOrders
        public void InsertOrders(Order order, ref List<string> errors)
        {
            BLOrders.InsertOrders(order, ref errors);
        }

        //GetTotalPrice
        public double GetTotalPrice(int id, ref List<string> errors)
        {
            return BLOrders.GetTotalPrice(id, ref errors);
        }

        //GetOrderProducts
        public List<OrderItem> GetOrderProducts(int id, ref List<string> errors)
        {
            return BLOrders.GetOrderProducts(id, ref errors);
        }

        //Delete all records
        public void DeleteAllRecords(ref List<string> errors)
        {
            BLOrders.DeleteAllRecords(ref errors);
        }

        //numOrderEntries
        public int NumOrderEntries(ref List<string> errors)
        {
            return BLOrders.NumOrderEntries(ref errors);
        }

        //PlaceOrder
        public void PlaceOrder(int order_num, ref List<string> errors)
        {
            BLOrders.PlaceOrder(order_num, ref errors);
        }

        //SeeIfOrderPlaced
        public int SeeIfOrderPlaced(int order_num, ref List<string> errors)
        {
            return BLOrders.SeeIfOrderPlaced(order_num, ref errors);
        }

        //SeeMyHistory
        public List<OrderItem> SeeMyHistory(int id, ref List<string> errors)
        {
            return BLOrders.SeeMyHistory(id, ref errors);
        }


        public List<Order> GetCustomerOrders(int id, ref List<string> errors)
        {
            return BLOrders.GetCustomerOrders(id, ref errors);
        }


    }
}
